# -*- coding: utf-8 -*-
# Created by liangfuting on 2020/6/17
# Copyright (c) 2020 liangfuting. All rights reserved.

from django.forms import Form,ModelForm
from rbac.models import Role

class RoleModelForm(ModelForm):
    class Meta:
        model=Role
        fields=['title',]

    def __init__(self,*args,**kwargs):
        super(RoleModelForm,self).__init__(*args,**kwargs)
        for name,field in self.fields.items():
            field.widget.attrs['class']='form-control'
            field.widget.attrs['placeholder']=field.label